<?php
header("content-type:text/html;charset=utf-8");
mysql_connect("localhost","root","root");
mysql_select_db("hotel");
$gender=$_GET["gender"];
$sql="select * from user where gender= '$gender'";
$res = mysql_query($sql);
$arr = array();
while($row = mysql_fetch_assoc($res)){
    array_push($arr,$row);
}
print_r(json_encode($arr));
?>